import $api from './request'
const api: any = {}
api.open = (path: string) => {
    return $api.request({
        url: "index_open",
        data: { path: path },
    })
}
api.create = (data: any) => {
    return $api.request({
        url: "index_create",
        data: data,
        notify: false,
    })
}
api.search = (data: any) => {
    console.log(data)
    return $api.request({
        url: "search",
        data: data,
    })
}
api.indexs = () => {
    return $api.request({
        url: "indexs",
        data: {},
    })
}
api.stat = () => {
    return $api.request({
        url: "index_stat",
        data: {},
    })
}
api.remove = (data: any) => {
    return $api.request({
        url: "index_remove",
        data: data,
    })
}
api.readDir = (data: any) => {
    return $api.request({
        url: "read_dir",
        data: data,
    })
}
api.update = (data: any) => {
    return $api.request({
        url: "index_update",
        data: data,
    })
}
api.find = (data: any) => {
    return $api.request({
        url: "index_find",
        data: data,
    })
}
export default api